package org.example.mapper;

import org.example.dto.NewUserDto;
import org.example.po.SubUser;
import org.example.po.User;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * @author liyishan
 * @date 2023/6/6 17:04
 * @apiNote
 */
@Mapper
public interface User4Mapper {
    @Mappings({
            @Mapping(source = "user.pwd",target = "password"),
            @Mapping(source = "subUser.name", target = "name")
    })
    NewUserDto userToUserDto(User user, SubUser subUser);

}
